##########################################################################

This replication archive contains all scripts to replicate the analysis in

Stiller, Yannick, Andreas Dür, and Robert A. Huber, Education and Trade Attitudes: Revisiting the Role of Economic Interest, World Trade Review.

##########################################################################

For the R-scripts to work directly, we suggest setting up the following structure of files and folders:

1. Unzip the replication_material.zip in a folder of your choice. 
2. If not created automatically, create subfolders named "created_data", "figures", "original_data", "tables", "third_party"
3. Retrieve the following third-party datasets which are not included in this archive for copyright reasons, and save them in the subfolder "third_party":	
	a) "Pew Research Global Attitudes Spring 2014 Dataset for Web.sav" from https://www.pewresearch.org/global/dataset/pew-research-spring-2014-global-attitudes-questionnaire/https://www.pewresearch.org/global/dataset/pew-research-spring-2014-global-attitudes-questionnaire/
	b) "SHDI Complete 4.0 (1).csv" from: https://globaldatalab.org/shdi/download_files/
4. Open the replication.Rproj
5. Open and execute script data.R to create data
6. Open and execute script analyses.R to run all analyses reported in the manuscript
5. Open and execute script descriptives.R to create descriptive information on core variables

###########################################################################

This replication archive contains the following files:

readme.txt -- this file 

data.R -- R script to load and process the original data 
analysis.R -- R script to perform the analyses
descriptives.R -- R script to produce descriptive tables and figures
prepTex.R -- R script which allows extracting regression tables using the texreg package with clustered standard errors
prepTex_split.R -- R script which allows extracting regression tables using the texreg package with clustered standard errors

Data:

./created_data/df_analyses.rds -- data file with all variables needed for the analysis
./created_data/df.rds -- processed PEW data before final adjustments for analysis
./original_data/comp.rds -- data file with competitiveness measure used in data.R
./original_data/education_recoding.xlsx -- data file with recoding of national education scales into primary, secondary, and tertiary education which is used in data.R
./original_data/region_matching.xlsx -- data file with recoding of subnational strata into regional codes for SHDI and comp.rds data which is used in data.R


###########################################################################

We used the following compute environment:

R version 4.1.2 (2021-11-01)
- Platform: x86_64-w64-mingw32/x64 (64-bit)
- Packages: car (v. 3.0-12), countrycode (v. 1.3.0), data.table (v. 1.14.2), effects (v. 4.2-0), foreign (v. 0.8-81), ggthemes (v. 4.2.4), ipumsr (v. 0.4.5), lmtest (v. 09-39), maps (v. 3.4.0), MASS (v. 7.3-54), mgsub (v. 1.7.3), psych (v. 2.1.9), questionr (v. 0.7.5), readxl (v. 1.3.1), sandwich (v. 3.0-1), texreg (v. 1.37.5), tidyverse (v. 1.1.1), wbstats (v. 1.0.4)

###########################################################################
